function userBrowser(){ /*获取用户浏览器信息*/
    var browserName=navigator.userAgent.toLowerCase();  
    if(/msie/i.test(browserName) && !/opera/.test(browserName)){  
        return 'IE';  
    }else if(/firefox/i.test(browserName)){  
        return 'Firefox';  
    }else if(/chrome/i.test(browserName) && /webkit/i.test(browserName) && /mozilla/i.test(browserName)){  
        return 'Chrome';  
    }else if(/opera/i.test(browserName)){  
        return 'Opera';  
    }else if(/webkit/i.test(browserName) &&!(/chrome/i.test(browserName) && /webkit/i.test(browserName) && /mozilla/i.test(browserName))){  
        return 'Safari';  
    }else{  
        return "unKnow";  
    }  
} 

function _getRandom(num){ /*0-num随机数*/return Math.floor(Math.random()*num)}

Array.indexOf || (Array.prototype.indexOf = function(obj) {                
        for(var i=0; i<this.length; i++)  { 
            if(this[i]==obj)  { 
                return i; 
           } 
       } 
       return -1; 
     } 
);
Array.lastIndexOf || (Array.prototype.lastIndexOf=function(item){
        var len=this.length;
        for(var i=len;i>=0;i--){
                if(this[i]===item){
                        return len-i;
                }
        }
        return -1;
	}
);
$.extend({/*扩展jquery库取url参数值*/
  getUrlVars: function(){
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
      hash = hashes[i].split('=');
      vars.push(hash[0]);
      vars[hash[0]] = hash[1];
    }
    return vars;
  },
  getUrlVar: function(name){
    return $.getUrlVars()[name];
  }
});
function Shake(t){//
     var i = 10,that = t;
     var Timer = setTimeout(active,25);
     function active(){
         if(i>=0){
             that.style.padding = 0;
             i%2 == 0 ? that.style.paddingLeft = i + "px" : that.style.paddingRight = i + "px";
             i--;
             Timer = setTimeout(active,25);
         }else{
             clearTimeout(Timer);
         };
     };
 }
